import requests from "@/utils/request";
//获取用户基本信息
export const getUserInfo = () => requests({ url: '/user/getUserInfo', method: 'get' });
//用户登录
export const userLogin = (params) => requests({ url: '/user/login', params, method: 'get' });
//退出登录
export const userLogOut = () => requests({ url: '/user/logout', method: 'get' });
//下载用户头像(通用)
export const downloadAvatar = (params) => requests({ url: '/manager/downloadAvatar', params, method: 'get', responseType: 'blob' });
//获取管理员基本信息
export const getManagerInfo = () => requests({ url: '/manager/getManagerInfo', method: 'get' });
//更新管理员信息
export const updateManagerInfo = (data) => requests({ url: '/manager/updateManagerInfo', data, method: 'put' });
//获取用户详细信息，用于展示个人主页
export const getUserDetails = () => requests({ url: '/user/getUserDetails', method: 'get' });
//更新用户基本信息
export const updateUserInfo = (data) => requests({ url: '/user/updateUserInfo', data, method: 'put' });
//修改密码（普通用户和管理员用户通用）
export const updatePassword = (params) => requests({ url: '/user/updatePassword', params, method: 'get' });
//获取档案录入权限
export const getFileWritePermissions = () => requests({ url: '/file-write-permission/getFileWritePermissions', method: 'get' });
//获取用户还没有申请的档案录入权限
export const getRemainFileWritePermissions = () => requests({ url: '/file-type/getRemainFileWritePermissions', method: 'get' });
//获取用户档案录入权限申请情况结果
export const getFileWritePermissionApplyResult = () => requests({ url: '/file-write-permission-application/getFileWritePermissionApplyResult', method: 'get' });
//根据管理员类型type查询管理员列表信息
export const getManagerListByType = (type, params) => requests({ url: `/manager/getManagerListByType/${type}`, params, method: 'get' });
//根据管理员id删除管理员信息（一级或一级管理员才有的权限）
export const deleteManagerById = (id) => requests({ url: `/manager/deleteManagerById/${id}`, method: 'delete' });
//获取所有大学列表
export const getAllUniversity = () => requests({ url: '/university/getAllUniversity', method: 'get' });
//新增管理员（一级或一级管理员才有的权限）
export const addManager = (data) => requests({ url: '/manager/addManager', data, method: 'post' });
//根据id查询大学信息
export const getUniversityById = (id) => requests({ url: `/university/getUniversityById/${id}`, method: 'get' });
//分页查询所有大学信息（超级管理员才有的权限）
export const getPageUniversity = (pageNo, pageSize) => requests({ url: `/university/getPageUniversity/${pageNo}/${pageSize}`, method: 'get' });
//新增大学（超级管理员才有的权限）
export const addUniversity = (data) => requests({ url: '/university/addUniversity', data, method: 'post' });
//根据大学id删除大学（超级管理员才有的权限）
export const deleteUniversityById = (id) => requests({ url: `/university/deleteUniversityById/${id}`, method: 'delete' });
//新增教师（二级管理员才有的权限）
export const addTeacherUser = (data) => requests({ url: '/manager/addTeacherUser', data, method: 'post' });
//根据学校id获取该校所有教师信息（二级管理员才有的权限）
export const getPageTeachersByUniversityId = (id, pageNo, pageSize) => requests({ url: `/manager/getPageTeachersByUniversityId/${id}/${pageNo}/${pageSize}`, method: 'get' });
//根据用户id删除相应的教师（二级管理员才有的权限）
export const deleteTeacherUserById = (userId) => requests({ url: `/manager/deleteTeacherUserById/${userId}`, method: 'delete' });
//根据学校id查询未处理的档案录入权限申请（二级管理员才有的权限）
export const getPageFileWritePersissionApplication = (universityId, pageNo, pageSize) => requests({ url: `/file-write-permission-application/getPageFileWritePersissionApplication/${universityId}/${pageNo}/${pageSize}`, method: 'get' });
//处理档案录入权限申请（二级管理员才有的权限）
export const handleFileWritePermissionApply = (data) => requests({ url: '/file-write-permission-application/handleFileWritePermissionApply', data, method: 'post' });
//下载档案录入权限申请证明材料（二级管理员才有的权限）
export const downloadProveFile = (params) => requests({ url: '/manager/downloadProveFile', params, method: 'get', responseType: 'blob' });
//学院档案录入（拥有权限college才可以录入）
export const addCollege = (data) => requests({ url: '/college/addCollege', data, method: 'post' });
//获取所有学院
export const getCollegeList = () => requests({ url: '/college/getCollegeList', method: 'get' });
//录入大学专业档案(拥有major权限)
export const addMajor = (data) => requests({ url: '/major/addMajor', data, method: 'post' });
//根据大学id获取大学专业列表
export const getMajorListByUniversityId = (universityId) => requests({ url: `/major/getMajorListByUniversityId/${universityId}`, method: 'get' });
//根据学校id查询该校所有老师
export const getTeacherListByUniversityId = (universityId) => requests({ url: `/user/getTeacherListByUniversityId/${universityId}`, method: 'get' });
//新增班级档案(拥有classes权限)
export const addClass = (data) => requests({ url: '/classes/addClass', data, method: 'post' });
//根据学院id查询专业列表
export const getMajorListByCollegeId = (collegeId) => requests({ url: `/major/getMajorListByCollegeId/${collegeId}`, method: 'get' });
//根据大学id查询学院列表
export const getCollegeListByUniversityId = (universityId) => requests({ url: `/college/getCollegeListByUniversityId/${universityId}`, method: 'get' });
//根据专业id查询班级列表
export const getClassListByMajorId = (majorId) => requests({ url: `/classes/getClassListByMajorId/${majorId}`, method: 'get' });
//新增学生个人档案(要拥有users权限)
export const addStudent = (data) => requests({ url: '/user/addStudent', data, method: 'post' });
//新增课程档案(拥有course权限)
export const addCourse = (data) => requests({ url: '/course/addCourse', data, method: 'post' });
//通过学生id获取学生档案回忆录
export const getFileMemoryByStudentId = (studentId) => requests({ url: `/user/getFileMemoryByStudentId/${studentId}`, method: 'get' });
//根据学生id分页查询其拥有的课程
export const getPageCoursesByStuId = (studentId, pageNo, pageSize) => requests({ url: `/course/getPageCoursesByStuId/${studentId}/${pageNo}/${pageSize}`, method: 'get' });




